package com.axjy.mapper;

import com.axjy.pojo.Systemconfig;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * Created by 00 on 2018/1/30.
 */
public interface SystemconfigMapper {
    public List<Systemconfig> peizhishow(@Param("offset") Integer offset,@Param("limit") Integer limit,@Param("peiStatus") Integer peiStatus);

    @Select("select count(1) from systemconfig where config_Name='缺陷类型'")
    public Integer peiTotal(@Param("peiStatus") Integer peiStatus);

//    public Systemconfig getByid(Integer id);

    @Select("SELECT MAX(config_Value_Id) mids FROM systemconfig WHERE config_Name='缺陷类型'")
    public Integer maxid();

    @Insert("INSERT INTO systemconfig(config_Code,config_Name,config_Value_Id,config_Value_Name,is_Start) VALUES('BUG_TYPE','缺陷类型',#{configValueId},#{configValueName},#{isStart})")
    public void add(Systemconfig systemconfig);

    @Update("UPDATE systemconfig SET config_Value_Name=#{configValueName},is_Start=#{isStart} where id=#{id}")
    public void update(Systemconfig systemconfig);

    public void del(Map<String,Object> ids);

    /**
     * 查询下拉
     * @return
     */
    @Select("SELECT * FROM systemconfig WHERE config_Name='缺陷类型'")
    public List<Systemconfig> search1();

    /**
     * 查询下拉
     * @return
     */
    @Select("SELECT * FROM systemconfig WHERE config_Name = '缺陷级别'")
    public List<Systemconfig> search2();


    /**
     * 修改状态
     * @param id
     */
    public void ztisstart(@Param("id") Integer id,@Param("isStart") Integer isStart);

}
